package imotech.ejb.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;

@Entity
@DiscriminatorValue("C")

@NamedQueries({
	@NamedQuery(name="findTodosClientes", query="select c from Cliente c"),
	@NamedQuery(name="findClientePorNome", query="select c from Cliente c WHERE LOWER(c.nome) LIKE :nome ")
})
public class Cliente extends Pessoa implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3619797492768641064L;

	private Collection<Imovel> imoveis = new ArrayList<Imovel>();
	private Collection<Agendamento> agendamentos = new ArrayList<Agendamento>();
	
	public Cliente() {
		// TODO Auto-generated constructor stub
	}

	@OneToMany(mappedBy="proprietario")
	public Collection<Imovel> getImoveis() {
		return imoveis;
	}
	public void setImoveis(Collection<Imovel> imoveis) {
		this.imoveis = imoveis;
	}

	@OneToMany(mappedBy="visitante")
	public Collection<Agendamento> getAgendamentos() {
		return agendamentos;
	}

	public void setAgendamentos(Collection<Agendamento> agendamentos) {
		this.agendamentos = agendamentos;
	}
	
	
	
	
	
}
